import time
from time import sleep
from selenium.webdriver.support.select import Select
from Finance_fun.base.base import Base
from Finance_fun import page

class Page_Promotion_Record(Base):
    '''以下为推广记录的界面操作'''
    # 点击推广记录链接
    def click_promotion_record(self):
        self.base_click(page.promotion_record)

    # 输入起始时间
    def input_start_time_promotion(self, starttime):
        self.base_input(page.start_time_promotion, starttime)

    # 输入截止时间
    def input_end_time_promotion(self, endtime):
        self.base_input(page.end_time_promotion, endtime)

    # 输入用户名
    def input_username_promotion(self, username):
        self.base_input(page.input_username_promotion, username)

    # 点击搜索按钮
    def click_search_btn_promotion(self):
        self.base_click(page.click_search_promotion)

    # 点击登录链接
    def page_click_login_link(self):
        self.base_click(page.login_link)

    # 输入登录手机号
    def page_input_login_phone(self, phone):
        self.base_input(page.login_phone, phone)

    # 输入登录密码
    def page_input_login_password(self, password):
        self.base_input(page.login_password, password)

    # 点击登录按钮
    def page_click_login_btn(self):
        self.base_click(page.login_btn)

    # 集成登录操作
    def page_login(self, phone, password):
        self.page_input_login_phone(phone)
        self.page_input_login_password(password)
        self.page_click_login_btn()
        sleep(1)